import { SourceMapConsumer } from 'source-map'
import data from '../path/test'

const rawSourceMap = data.mapD

SourceMapConsumer.with(rawSourceMap, null, consumer => {
  console.log(consumer.sources);
  // [ 'http://example.com/www/js/one.js',
  //   'http://example.com/www/js/two.js' ]

  console.log(
    consumer.originalPositionFor({
      line: 1,
      column: 54141
    })
  );
  // { source: 'http://example.com/www/js/two.js',
  //   line: 2,
  //   column: 10,
  //   name: 'n' }

  console.log(
    consumer.generatedPositionFor({

      source: consumer.sources.pop()!,
      line: 5,
      column: 27
    })
  );
  // { line: 2, column: 28 }

  consumer.eachMapping(function(m) {
    // ...
  });

  return {};
}).then(r => console.log(r))
export default { }
